package com.woniuxy.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.woniuxy.mapper.UserMapper;
import com.woniuxy.pojo.User;
import com.woniuxy.service.UserService;

import lombok.Data;

@Data
@Service
@Transactional
public class UserServiceImp implements UserService{
	@Resource
	private UserMapper userMapper;

	@Override
	public List<User> getAllAdmin() {
		return userMapper.getAllAdmin();
	}

	@Override
	public User findUserByAccount(String account) {
		return userMapper.findUserByAccount(account);
	}

	@Override
	public int addAdmin(User user) {
		return userMapper.addAmin(user);
	}

	@Override
	public int updateAdmin(User user) {
		return userMapper.updateAdmin(user);
	}

	@Override
	public int delAdmin(String account) {
		return userMapper.delAdmin(account);
	}

	@Override
	public List<User> find(String message) {
		return userMapper.findA("%"+message+"%");
	}


	@Override
	public int regmember(String mnumber, String mname, String mtel, String mtype) {
		return userMapper.regmember(mnumber,mname,mtel,mtype);
	}

	@Override
	public int findMidByMnumber(String mnumber) {
		return userMapper.findMidByMnumber(mnumber);
	}

	@Override
	public int register(String account, String pass, int mid,String ustate) {
		return userMapper.register(account, pass, mid,ustate);
	}
	@Override
	public User FindIdByUser(Integer uid) {
		// TODO Auto-generated method stub
		return userMapper.FindIdByUser(uid);
	}

	@Override
	public String Findsf(Integer uid) {
		return userMapper.FindSf(uid);
	}

	@Override
	public User findUserByTel(String tel) {
		return userMapper.findUserByTel(tel);
	}


}
